package com.moly.grpc.server.studentmessage;

import io.grpc.Server;
import io.grpc.ServerBuilder;

import java.io.IOException;

public class StudentMessageServer {

    public static void main(String[] args) {



        Server server = ServerBuilder.forPort(8999).addService(new StudentServiceImpl()).build();
        System.out.println();
        try {
            server.start();
            System.out.println("begin");
            server.awaitTermination();

            System.out.println("over");
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}


 /* Server localhost = NettyServerBuilder
                .forAddress(new InetSocketAddress("localhost", 8899))
                .addService(new StudentServiceImpl()).build();*/